import java.util.Scanner;

/**
 * @Author YuanYuan
 * @Date 2022/4/29
 * @Time 15:08
 */
public class TestDemo {
    public static void printfEvery(int n) {
        if(n/10 == 0) {
            System.out.println(n);
        }else {
            printfEvery(n/10);
            System.out.println(n%10);

        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        printfEvery(n);
    }
}
